package com.example.TestCode.JavaBasics;


class Animal {
    public void sound() {
        System.out.println("Animal sound");
    }
}
public class Dog extends Animal {
    // 方法重写
    @Override
    public void sound() {
        System.out.println("Dog sound");
    }
    // 方法重载
    public void sound(int count) {
        for (int i = 0; i < count; i++) {
            System.out.println("Dog sound:" + i);
        }
    }
}

